package cn.tedu.spring.di;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestUserDao {
    public static void main(String[] args) {
//        ApplicationContext context=new  AnnotationConfigApplicationContext("cn.tedu.spring.di");
//        UserService userService = context.getBean(UserService.class);
//        System.out.println("UserService:"+UserService);

        System.out.println(new AnnotationConfigApplicationContext("cn.tedu.spring.di").getBean(UserService.class));


        ApplicationContext context=new  AnnotationConfigApplicationContext("cn.tedu.spring.di");
        UserDao userDao = context.getBean(UserDao.class);
        System.out.println("userDao:"+userDao);
    }
}
